<!DOCTYPE html>
<html>
  <head> </head>

  <body>
    <script src="../lib/index.js"></script>
    <script>
      const { createRequire, createRequest } = mfoRequire;

      const t = `?t=${new Date().getTime()}`;
      const req = createRequire({
        base: "../src/",
        alias: {
          header: "modules/header.js" + t,
          footer: "modules/footer.js" + t,
          getter: "modules/getter.js" + t,
        },
      });

      define(["header", "footer"], (require, exports) => {
        const { header } = require("header"),
          { footer } = require("footer");
        console.log(JSON.stringify(header), JSON.stringify(footer));

        req
          .load(["header", "footer"])
          .then((res) => {
            console.log(JSON.stringify(res));
          })
          .catch((err) => console.error(err));
      });

      createRequest({
        url: "../src/modules/getter.js" + t,
        success() {
          console.log("success");
        },
        catch(err) {
          console.error(err);
        },
      });

      console.log(req);
    </script>
  </body>
</html>
